package com.mini.service.impl;

import com.mini.dao.ModelInfoMapper;
import com.mini.pojo.basic.ModelInfo;
import com.mini.service.ModelInfoServic;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class ModelInfoServicImpl implements ModelInfoServic {

    @Autowired
    private ModelInfoMapper modelInfoMapper;

    public void addModelInfo(ModelInfo modelInfo) {
        modelInfo.setCreatedBy("test");
        modelInfo.setCreatedTime(new Date());
        modelInfo.setUpdatedBy("test");
        modelInfo.setUpdatedTime(new Date());
        modelInfoMapper.addModelInfo(modelInfo);
    }

    public void updateModelInfo(ModelInfo modelInfo) {
        modelInfo.setUpdatedBy("test");
        modelInfo.setUpdatedTime(new Date());
        modelInfoMapper.updateModelInfo(modelInfo);
    }

    public void removeModelInfo(ModelInfo modelInfo) {
        modelInfo.setUpdatedBy("test");
        modelInfo.setUpdatedTime(new Date());
        modelInfoMapper.removeModelInfo(modelInfo);
    }

    public ModelInfo queryModelInfo(int modelinfoId) {
        return modelInfoMapper.queryModelInfo(modelinfoId);
    }

    public List<ModelInfo> queryAllModelInfo() {
        return modelInfoMapper.queryAllModelInfo();
    }
}
